<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<html>
<head>
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="<c:url value="/css/bootstrap.css"/>">
    <script type="text/javascript" src="<c:url value="/js/sockjs.js"/>"></script>
    <script type="text/javascript" src="<c:url value="/js/jquery-3.2.1.min.js"/>"></script>
    <script type="text/javascript">

        var sock = new SockJS("http://localhost:9090/lending-web/websocket/sendMessage");

        sock.onmessage = function(event){
            $("#messageBoy").append("<p>"+event.data+"</p>")
        }

        $(document).ready(function(){
            $("#btn_send_Message").click(function(){
                sock.send("test")
            });
        });
    </script>
</head>
<body>
    <div>
        <div >
            <div style="height: 80%;overflow: scroll;" class="well well-lg" id="messageBoy">
                <p><span class="label label-default">客服MM</span>:你好</p>
                <p><span class="label label-default">用户</span>:你好</p>
            </div>
        </div>

        <div>
            <div class="form-group">
                <textarea class="form-control" rows="3"></textarea>
                <button class="btn btn-primary" id="btn_send_Message">发送</button>
            </div>
        </div>
    </div>
</body>
</html>